package demo1;

//上下文
public class Context {
    //context 用一个ConcreteStrategy 来配置维护一个对Strategy对象的引用
    Strategy strategy ;
    public Context(Strategy strategy){
        this.strategy = strategy;
    }

    //上下文接口
    public void ContextInterface(){
        //执行算法
        strategy.AlgorithmInterface();
    }
}
